package com.cskaoyan.service.mall;

import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.po.MarketRegionExample;
import com.cskaoyan.bean.vo.mall.AdministrativeRegionListEntityVo;
import com.cskaoyan.mapper.MarketRegionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class AdministrativeServicelmpl implements AdministrativeService {

    @Autowired
    MarketRegionMapper marketRegionMapper;

    @Override
    public CommonData<AdministrativeRegionListEntityVo> queryRegionPage() {

        List<AdministrativeRegionListEntityVo> administrativeRegionListEntityVos = marketRegionMapper.queryRegionPage();


        MarketRegionExample marketRegionExample = new MarketRegionExample();
        MarketRegionExample.Criteria criteria = marketRegionExample.createCriteria();
        criteria.andPidEqualTo(0);
        int total = (int) marketRegionMapper.countByExample(marketRegionExample);

        return new CommonData<>(total, 1, total, 1, administrativeRegionListEntityVos);
    }

}
